package tt.dz.egobus.servicemanager.business.point;

/**
 * @author Anson
 * @date 17-3-31
 * @name 地理位置
 * @since 1.0.3
 */
public class AddressPoint extends CommonPoint {
    private static final long serialVersionUID = -8196872388487756588L;


    protected String address;


    public static long getSerialVersionUID() {
        return serialVersionUID;
    }


    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public boolean equals(Object o) {

        if (this == o) return true;
        if (!(o instanceof AddressPoint)) return false;

        AddressPoint that = (AddressPoint) o;

        if (Double.compare(that.getX(), getX()) != 0) return false;
        if (Double.compare(that.getY(), getY()) != 0) return false;
        return address != null ? address.equals(that.address) : that.address == null;

    }

    @Override
    public int hashCode() {
        int result = 0;
        long temp;
        temp = Double.doubleToLongBits(getX());
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        temp = Double.doubleToLongBits(getY());
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        result = 31 * result + (address != null ? address.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "AddressPoint{" +
                " x=" + x +
                ", y=" + y +
                ", address='" + address + '\'' +
                '}';
    }
}
